package com.asia5b.a5mall.order.activity

import androidx.recyclerview.widget.LinearLayoutManager
import com.asia5b.a5mall.middleware.base.SimpleActivity
import com.asia5b.a5mall.middleware.base.SimpleViewModel
import com.asia5b.a5mall.middleware.model.shop.OrderParcelDetailModel
import com.asia5b.a5mall.order.R
import com.asia5b.a5mall.order.adapter.ParcelDetailAdapter
import com.asia5b.a5mall.order.databinding.ActivityOrderparcelBinding
import kotlinx.android.synthetic.main.activity_orderparceldetail.*

/**
 * Created by zhangyuncai on 2020/3/16.
 */
class OrderParcelDetailActivity : SimpleActivity<SimpleViewModel, ActivityOrderparcelBinding>() {
    override val viewModelClazz: Class<SimpleViewModel>
        get() = SimpleViewModel::class.java

    override fun getDataBinding(): ActivityOrderparcelBinding {
        return ActivityOrderparcelBinding.inflate(layoutInflater)
    }
    override var sIsDark = true
    val parcelRecyclerView by lazy {
        rv_orderparcel
    }


    override fun initView() {
        var orderParcelDetailModel = intent.getSerializableExtra("data") as OrderParcelDetailModel
        val express_list = orderParcelDetailModel?.express_list!!
        val parcelAdapter = ParcelDetailAdapter(express_list)
        parcelRecyclerView.run {
            layoutManager = LinearLayoutManager(mActivity)!!
            adapter = parcelAdapter
        }
        tv_parcel_ordersn.text =String.format(getString(R.string.订单号_数),"${orderParcelDetailModel.order_sn}")
    }

    override fun initEvent() {
    }

    override fun initData() {
    }

}

